#include "types.h"
#include "stat.h"
#include "user.h"

void handler();

void handler()
{
	printf(1,"\nMY OWN HANDLER!!!!! \n");
}

int main(void)
{
  int ticks = 1000;
  int i;
  alarm(ticks);
  ticks = 3;
  alarm(ticks);
  for(i=0;i<50;i++)
  {
	printf(1,"child %d FINISHED CALC! \n",i);
  }
  alarm(ticks);
  sighandler_t h = (sighandler_t)handler;
  signal(14,h);
  for(i=0;i<50;i++)
  {
	printf(1,"child %d FINISHED CALC! \n",i);
  }
  
  alarm(1);
  for(i=0;i<50;i++)
  {
	printf(1,"child %d FINISHED CALC! \n",i);
	if(i==0)
	  alarm(0);
  }
  
  exit();
}
